package DatabaseImpl;

import java.sql.ResultSet;

import Database.DBconnecter;
import DatabasePO.StudentPO;


public class StudentImpl {
	
	String sql;
	ResultSet rs=null;
	
	public StudentPO find(String userid){
		DBconnecter con=new DBconnecter();
		sql="select * from studentB where num='"+userid+"'";
		StudentPO s=new StudentPO(null,null,null,null,null);
		try{
			con.getDBConnect();
			rs=con.executeQuery(sql);
			if(rs.next()){
				s.setNum(rs.getString("num"));
				s.setName(rs.getString("name"));
				s.setDepartment(rs.getString("department"));
				s.setSex(rs.getString("sex"));
				s.setPassword(rs.getString("password"));
				
				//System.out.println(s.getName());
			}
		}catch(Exception e){
			
		}finally{
			
			con.closeStmt();
			con.closecon();
		}
		
		return s;
	}
	
	

}
